home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / HUD / CHUD.as next >
Encoding:
Text File  |  2011-08-19  |  24.0 KB  |  801 lines

  1. package Local.Game.HUD
  2. {
  3.    import Local.*;
  4.    import Local.External.*;
  5.    import Local.Game.*;
  6.    import Local.Game.Level.*;
  7.    import Local.Game.Thing.*;
  8.    import Local.Game.World.*;
  9.    import Local.Game.World.Map.*;
  10.    import Local.Game.World.Map.Cell.*;
  11.    import Local.Math.*;
  12.    import STC9.IO.*;
  13.    import STC9.System.*;
  14.    import flash.display.*;
  15.    import flash.events.*;
  16.    import flash.filters.*;
  17.    import flash.geom.*;
  18.    import flash.text.*;
  19.    
  20.    public class CHUD extends Sprite
  21.    {
  22.       
  23.       public static const SECONDS:int = CThingBase.SECONDS;
  24.        
  25.       
  26.       internal var mGame:CGame;
  27.       
  28.       private var mProcessIcons:Array;
  29.       
  30.       private var _SelectedPanel:CHUDPanel;
  31.       
  32.       private var mcSelectedThing:MovieClip;
  33.       
  34.       private var mControlButtons:Object;
  35.       
  36.       internal var mThingSelected:*;
  37.       
  38.       private var mThingTargets:Object;
  39.       
  40.       private var mUpdateFunds:Boolean;
  41.       
  42.       private var mcHUD:MovieClip;
  43.       
  44.       private var tbFunds:TextField;
  45.       
  46.       private var mcHealth:MovieClip;
  47.       
  48.       private var mUpdateHealth:Boolean;
  49.       
  50.       private var _Health:Number;
  51.       
  52.       private var tbDescription:TextField;
  53.       
  54.       private var tbAddFunds:TextField;
  55.       
  56.       private var prevSelectedPanel:CHUDPanel;
  57.       
  58.       internal var mPanels:Object;
  59.       
  60.       public var mFundsSecure:CSecureNumber;
  61.       
  62.       public var mPlayState:String;
  63.       
  64.       private var tbSubHealth:TextField;
  65.       
  66.       private var mFundsChange:Number;
  67.       
  68.       private var mMaxHealth:Number;
  69.       
  70.       public var _Description_Default:String = "NO MESSAGE";
  71.       
  72.       public function CHUD(param1:CGame)
  73.       {
  74.          if(true)
  75.          {
  76.             _Description_Default = "NO MESSAGE";
  77.             if(true)
  78.             {
  79.                super();
  80.                mGame = param1;
  81.             }
  82.             addEventListener(Event.ADDED_TO_STAGE,Initialize);
  83.          }
  84.       }
  85.       
  86.       public static function NumberToDollar(param1:Number) : String
  87.       {
  88.          var _loc2_:String = null;
  89.          var _loc3_:String = null;
  90.          var _loc4_:String = null;
  91.          var _loc5_:* = 0;
  92.          var _loc6_:* = 0;
  93.          _loc2_ = String(Math.floor(param1));
  94.          _loc3_ = "###,###,###,###,###,###";
  95.          _loc4_ = "";
  96.          ┬º┬ºpush(_loc2_.length - 1);
  97.          if(true)
  98.          {
  99.             ┬º┬ºpush(┬º┬ºpop());
  100.             if(true)
  101.             {
  102.                _loc5_ = ┬º┬ºpop();
  103.                addr52:
  104.                ┬º┬ºpush(_loc3_.length - 1);
  105.             }
  106.             _loc6_ = ┬º┬ºpop();
  107.             while(_loc5_ >= 0)
  108.             {
  109.                if(_loc3_.charAt(_loc6_) == "#")
  110.                {
  111.                   if(false)
  112.                   {
  113.                      break;
  114.                   }
  115.                   ┬º┬ºpush(_loc2_);
  116.                   ┬º┬ºpush(_loc5_);
  117.                   ┬º┬ºpush(_loc5_);
  118.                   if(true)
  119.                   {
  120.                      ┬º┬ºpush(┬º┬ºpop() - 1);
  121.                   }
  122.                   _loc5_ = ┬º┬ºpop();
  123.                   ┬º┬ºpush(┬º┬ºpop().charAt(┬º┬ºpop()));
  124.                }
  125.                else
  126.                {
  127.                   ┬º┬ºpush(",");
  128.                }
  129.                _loc4_ = ┬º┬ºpop() + _loc4_;
  130.                if(true)
  131.                {
  132.                   _loc6_--;
  133.                }
  134.             }
  135.             return "$" + _loc4_;
  136.          }
  137.          ┬º┬ºgoto(addr52);
  138.       }
  139.       
  140.       public static function NumberToScore(param1:Number) : String
  141.       {
  142.          var _loc2_:String = null;
  143.          if(true)
  144.          {
  145.             _loc2_ = String(Math.floor(param1));
  146.          }
  147.          while(true)
  148.          {
  149.             if(_loc2_.length >= 12)
  150.             {
  151.                ┬º┬ºpush("SCORE: " + _loc2_);
  152.                break;
  153.             }
  154.             ┬º┬ºpush("0" + _loc2_);
  155.             if(false)
  156.             {
  157.                break;
  158.             }
  159.             _loc2_ = ┬º┬ºpop();
  160.          }
  161.          return ┬º┬ºpop();
  162.       }
  163.       
  164.       private function ALPHA_Start(param1:DisplayObject) : void
  165.       {
  166.          if(true)
  167.          {
  168.             param1.alpha = 3;
  169.             GLOW_Start(param1);
  170.          }
  171.       }
  172.       
  173.       public function Dispose() : void
  174.       {
  175.       }
  176.       
  177.       private function AddPanel(param1:MovieClip, param2:MovieClip, param3:Function, param4:Function = null, param5:Function = null, param6:Boolean = false) : CHUDPanel
  178.       {
  179.          var _loc7_:CHUDPanel = null;
  180.          _loc7_ = new CHUDPanel(this,param2,param1,param6);
  181.          mPanels[_loc7_.mID] = _loc7_;
  182.          if(param5 != null)
  183.          {
  184.             _loc7_.addEventListener(CHUDPanel.DRAWPANEL,param5);
  185.          }
  186.          if(param4 != null)
  187.          {
  188.             _loc7_.addEventListener(CHUDPanel.SELECTED,param4);
  189.          }
  190.          param3(_loc7_);
  191.          return _loc7_;
  192.       }
  193.       
  194.       private function Compile(param1:MovieClip) : void
  195.       {
  196.          var _loc2_:CHUDPanelMap = null;
  197.          var _loc3_:CHUDPanelUnit = null;
  198.          var _loc4_:CHUDData = null;
  199.          addChild(mcHUD = param1);
  200.          mcHUD.mcSize.visible = false;
  201.          mcHUD.removeChild(mcHUD.mcSize);
  202.          CHUDPanel.SetDefaults(mcHUD);
  203.          tbFunds = mcHUD.tbFunds;
  204.          mcHealth = mcHUD.mcHealth;
  205.          tbSubHealth = mcHUD.tbSubHealth;
  206.          tbAddFunds = mcHUD.tbAddFunds;
  207.          tbSubHealth.alpha = 0;
  208.          tbAddFunds.alpha = 0;
  209.          tbDescription = mcHUD.tbDescription;
  210.          tbDescription.text = "";
  211.          mPanels = new Object();
  212.          _loc2_ = new CHUDPanelMap(this);
  213.          _loc3_ = new CHUDPanelUnit(this);
  214.          _loc4_ = new CHUDData(this);
  215.          if(true)
  216.          {
  217.             AddPanel(mcHUD.mcTabUnits,mcHUD.mcPanelUnits,_loc4_.InitPanel_Units,e_PANEL_SELECTED);
  218.             if(true)
  219.             {
  220.                AddPanel(mcHUD.mcTabStrikes,mcHUD.mcPanelStrikes,_loc4_.InitPanel_Strikes,e_PANEL_SELECTED);
  221.                if(true)
  222.                {
  223.                   AddPanel(mcHUD.mcTabMap,mcHUD.mcPanelMap,_loc4_.InitPanel_Map,e_PANEL_SELECTED,_loc2_.e_DRAW,true);
  224.                   if(true)
  225.                   {
  226.                      AddPanel(mcHUD.mcTabUpgrades,mcHUD.mcPanelUpgrades,_loc4_.InitPanel_Upgrades,e_PANEL_SELECTED);
  227.                      if(true)
  228.                      {
  229.                         AddPanel(null,mcHUD.mcPanelUnit,_loc4_.InitPanel_Unit,e_PANELUNIT_SELECTED,_loc3_.e_DRAW);
  230.                         if(true)
  231.                         {
  232.                            new CHUDTooltip(this,mcHUD.mcTabUnits,"Click on this to activate the units panel. Here you can build new units.");
  233.                            if(true)
  234.                            {
  235.                               new CHUDTooltip(this,mcHUD.mcTabStrikes,"Click on this to activate the strikes panel. Here you can call & launch new strikes.");
  236.                               if(true)
  237.                               {
  238.                                  new CHUDTooltip(this,mcHUD.mcTabUpgrades,"Click on this to activate the upgrades panel. Here you can upgrade your arsenal, bringing new tools to the fight.");
  239.                                  if(true)
  240.                                  {
  241.                                     new CHUDTooltip(this,mcHUD.bGetHelp,"Click to open the help pages. Here you will find more details of the game.");
  242.                                     mcHUD.bGetHelp.addEventListener(MouseEvent.MOUSE_UP,e_OPEN_HELP);
  243.                                  }
  244.                                  GetPanel("map").Activate();
  245.                               }
  246.                               GetPanel("units").Activate();
  247.                            }
  248.                            mcHUD.mcBG.opaqueBackground = 16711935;
  249.                         }
  250.                         mcHUD.mcBG.cacheAsBitmap = true;
  251.                      }
  252.                      new CHUDTooltip(this,mcHUD.mcTTLevel,"This is the current level status, the level number or the next level number and time to next.",false);
  253.                   }
  254.                   new CHUDTooltip(this,mcHUD.mcTTHealth,"This is the health of your current mission. When an enemy unit reaches your side health is removed.",false);
  255.                }
  256.                new CHUDTooltip(this,mcHUD.mcTTFunds,"This is the total amount of funds you have to build, upgrade and launch strikes.",false);
  257.             }
  258.             y = CMain.mSize.height - mcHUD.mcSize.height;
  259.          }
  260.       }
  261.       
  262.       public function get mLevel() : CLevel
  263.       {
  264.          return mGame.mWorld.mLevel;
  265.       }
  266.       
  267.       public function get mLowHealth() : Boolean
  268.       {
  269.          return mHealth / mMaxHealth <= 0.15;
  270.       }
  271.       
  272.       public function DeselectThing() : void
  273.       {
  274.          if(true)
  275.          {
  276.             if(mThingSelected)
  277.             {
  278.                if(true)
  279.                {
  280.                   mThingSelected.mMouseSelected = false;
  281.                   addr25:
  282.                   mThingSelected = null;
  283.                }
  284.                mcSelectedThing.visible = false;
  285.                ┬º┬ºgoto(addr31);
  286.             }
  287.             ┬º┬ºgoto(addr25);
  288.          }
  289.          addr31:
  290.       }
  291.       
  292.       public function Control_Play() : void
  293.       {
  294.          SelectControlButton(mcHUD.mcControl.bPlay);
  295.       }
  296.       
  297.       private function e_ACTION_SELECTFRIEND(param1:Event = null) : void
  298.       {
  299.          if(true)
  300.          {
  301.             SelectThing(mMouse.mOverThing);
  302.          }
  303.       }
  304.       
  305.       private function GLOW_Start(param1:DisplayObject) : void
  306.       {
  307.          param1.filters = [new GlowFilter(16777215,1,2,2,4)];
  308.       }
  309.       
  310.       private function GetControlButtonID(param1:String) : Object
  311.       {
  312.          return mControlButtons[param1];
  313.       }
  314.       
  315.       public function get mMouse() : CMouse
  316.       {
  317.          return mGame.mWorld.mMouse;
  318.       }
  319.       
  320.       public function get mStrikesReady() : Boolean
  321.       {
  322.          return GetPanel("strikes").mStrikesReady;
  323.       }
  324.       
  325.       public function get mBuilding() : Boolean
  326.       {
  327.          if(true)
  328.          {
  329.             return GetPanel("units").mBuilding || GetPanel("strikes").mBuilding || GetPanel("upgrades").mBuilding;
  330.          }
  331.          ┬º┬ºgoto(addr34);
  332.       }
  333.       
  334.       public function get mWorld() : CWorld
  335.       {
  336.          return mGame.mWorld;
  337.       }
  338.       
  339.       private function ALPHA_Process(param1:DisplayObject) : void
  340.       {
  341.          if(true)
  342.          {
  343.             if(param1.alpha > 0)
  344.             {
  345.                if(true)
  346.                {
  347.                   if((param1.alpha = param1.alpha - 0.03) < 0)
  348.                   {
  349.                      param1.alpha = 0;
  350.                   }
  351.                }
  352.             }
  353.             GLOW_Process(param1);
  354.          }
  355.       }
  356.       
  357.       public function get mDescription() : String
  358.       {
  359.          return tbDescription.text;
  360.       }
  361.       
  362.       public function set mHealth(param1:Number) : void
  363.       {
  364.          var _loc2_:Number = NaN;
  365.          _loc2_ = Math.floor(param1 - _Health);
  366.          tbSubHealth.text = Math.floor(_loc2_ / mMaxHealth * 100) + "%";
  367.          _Health = Math.max(0,param1);
  368.          mUpdateHealth = true;
  369.          mcHealth.gotoAndStop(Math.ceil(mcHealth.totalFrames * mHealth / mMaxHealth) + 1);
  370.       }
  371.       
  372.       public function Draw() : void
  373.       {
  374.          var _loc1_:Point = null;
  375.          var _loc2_:Object = null;
  376.          mPanels["map"].Draw();
  377.          mSelectedPanel.Draw();
  378.          if(mThingSelected)
  379.          {
  380.             if(mThingSelected.mDisposed)
  381.             {
  382.                DeselectThing();
  383.                return;
  384.             }
  385.             _loc1_ = mThingSelected.mCollide.mMid.subtract(mLandscape.mDrawPosition);
  386.             if(true)
  387.             {
  388.                mcSelectedThing.x = _loc1_.x;
  389.                mcSelectedThing.y = _loc1_.y - y;
  390.             }
  391.          }
  392.          for each(_loc2_ in mThingTargets)
  393.          {
  394.             ┬º┬ºpush(Boolean(_loc2_.selectedThing.mDead));
  395.             if(true)
  396.             {
  397.                ┬º┬ºpush(┬º┬ºpop() || Boolean(_loc2_.killThing.mDisposed));
  398.             }
  399.             if(┬º┬ºpop())
  400.             {
  401.                RemoveTarget(_loc2_.selectedThing);
  402.             }
  403.             else
  404.             {
  405.                _loc1_ = _loc2_.selectedThing.mCollide.mMid.subtract(mLandscape.mDrawPosition);
  406.                _loc2_.mc.x = _loc1_.x;
  407.                _loc2_.mc.y = _loc1_.y - y;
  408.             }
  409.          }
  410.       }
  411.       
  412.       private function e_BUTTON_UP(param1:MouseEvent = null) : void
  413.       {
  414.          SelectControlButton(SimpleButton(param1.currentTarget));
  415.       }
  416.       
  417.       public function ResetDescription() : void
  418.       {
  419.          mDescription = _Description_Default;
  420.       }
  421.       
  422.       private function GetControlButton(param1:SimpleButton) : Object
  423.       {
  424.          var _loc2_:Object = null;
  425.          for each(_loc2_ in mControlButtons)
  426.          {
  427.             if(_loc2_.mButton == param1)
  428.             {
  429.                return param1;
  430.             }
  431.          }
  432.          return null;
  433.       }
  434.       
  435.       public function GetPanel(param1:String) : CHUDPanel
  436.       {
  437.          return mPanels[param1];
  438.       }
  439.       
  440.       public function RemoveTarget(param1:CThingMain) : void
  441.       {
  442.          if(true)
  443.          {
  444.             removeChild(mThingTargets[param1.mID].mc);
  445.             delete mThingTargets[param1.mID];
  446.          }
  447.       }
  448.       
  449.       public function Process() : void
  450.       {
  451.          var _loc1_:CHUDPanel = null;
  452.          for each(_loc1_ in mPanels)
  453.          {
  454.             if(true)
  455.             {
  456.                _loc1_.ProcessIcons();
  457.             }
  458.          }
  459.          if(true)
  460.          {
  461.             if(mUpdateFunds)
  462.             {
  463.                if(true)
  464.                {
  465.                   tbFunds.text = NumberToDollar(mFunds);
  466.                   if(true)
  467.                   {
  468.                      tbAddFunds.text = (mFundsChange < 0 ? "-" : "+") + NumberToDollar(Math.abs(mFundsChange));
  469.                      if(true)
  470.                      {
  471.                         mUpdateFunds = false;
  472.                         if(true)
  473.                         {
  474.                            GLOW_Start(tbFunds);
  475.                            if(true)
  476.                            {
  477.                               ALPHA_Start(tbAddFunds);
  478.                               if(true)
  479.                               {
  480.                                  addr99:
  481.                                  if(mUpdateHealth)
  482.                                  {
  483.                                     addr101:
  484.                                     mUpdateHealth = false;
  485.                                  }
  486.                                  else
  487.                                  {
  488.                                     GLOW_Process(mcHealth);
  489.                                     addr114:
  490.                                     ALPHA_Process(tbSubHealth);
  491.                                     addr117:
  492.                                     if(mLowHealth)
  493.                                     {
  494.                                        mcHealth.alpha = Math.abs((4 - mGame.mTick % 9) / 4);
  495.                                        addr138:
  496.                                        return;
  497.                                        addr119:
  498.                                     }
  499.                                     ┬º┬ºgoto(addr138);
  500.                                  }
  501.                                  ┬º┬ºgoto(addr117);
  502.                               }
  503.                               GLOW_Start(mcHealth);
  504.                            }
  505.                            ALPHA_Start(tbSubHealth);
  506.                         }
  507.                         ┬º┬ºgoto(addr117);
  508.                      }
  509.                   }
  510.                   ┬º┬ºgoto(addr114);
  511.                }
  512.                ┬º┬ºgoto(addr119);
  513.             }
  514.             else
  515.             {
  516.                GLOW_Process(tbFunds);
  517.                if(true)
  518.                {
  519.                   ALPHA_Process(tbAddFunds);
  520.                   if(true)
  521.                   {
  522.                      mFundsChange = 0;
  523.                   }
  524.                   ┬º┬ºgoto(addr99);
  525.                }
  526.             }
  527.             ┬º┬ºgoto(addr101);
  528.          }
  529.          ┬º┬ºgoto(addr138);
  530.       }
  531.       
  532.       public function DeselectAll(param1:Boolean = true, param2:Boolean = true) : void
  533.       {
  534.          var _loc3_:CHUDPanel = null;
  535.          if(true)
  536.          {
  537.             if(param2)
  538.             {
  539.                DeselectThing();
  540.             }
  541.          }
  542.          for each(_loc3_ in mPanels)
  543.          {
  544.             _loc3_.DeselectAll();
  545.          }
  546.          if(true)
  547.          {
  548.             ┬º┬ºpush(param1);
  549.             if(true)
  550.             {
  551.                ┬º┬ºpush(┬º┬ºpop());
  552.                if(true)
  553.                {
  554.                   if(┬º┬ºpop())
  555.                   {
  556.                   }
  557.                   ┬º┬ºgoto(addr60);
  558.                }
  559.                ┬º┬ºpop();
  560.                if(true)
  561.                {
  562.                   ┬º┬ºpush(prevSelectedPanel);
  563.                   if(true)
  564.                   {
  565.                      addr60:
  566.                      if(┬º┬ºpop())
  567.                      {
  568.                         addr69:
  569.                         prevSelectedPanel.Activate();
  570.                      }
  571.                      addr70:
  572.                      mMouse.ClearFilter();
  573.                      return;
  574.                      ┬º┬ºpush(┬º┬ºpop());
  575.                   }
  576.                   ┬º┬ºgoto(addr69);
  577.                }
  578.                ┬º┬ºgoto(addr70);
  579.             }
  580.          }
  581.          ┬º┬ºgoto(addr60);
  582.       }
  583.       
  584.       public function AddTarget(param1:CThingMain, param2:CThingMain) : void
  585.       {
  586.          if(true)
  587.          {
  588.             mThingTargets[param1.mID] = {
  589.                "selectedThing":param1,
  590.                "killThing":param2,
  591.                "mc":new Unit_Targetted()
  592.             };
  593.             addChild(mThingTargets[param1.mID].mc);
  594.          }
  595.       }
  596.       
  597.       public function SelectThing(param1:*) : void
  598.       {
  599.          if(true)
  600.          {
  601.             DeselectThing();
  602.             if(true)
  603.             {
  604.                mThingSelected = param1;
  605.                if(true)
  606.                {
  607.                   mThingSelected.mMouseSelected = true;
  608.                }
  609.                mPanels["unit"].Activate();
  610.             }
  611.             mcSelectedThing.visible = true;
  612.          }
  613.       }
  614.       
  615.       public function set mSelectedPanel(param1:CHUDPanel) : void
  616.       {
  617.          if(true)
  618.          {
  619.             _SelectedPanel = param1;
  620.          }
  621.       }
  622.       
  623.       private function GLOW_Process(param1:DisplayObject) : void
  624.       {
  625.          var _loc2_:GlowFilter = null;
  626.          if(param1.filters.length)
  627.          {
  628.             _loc2_ = param1.filters[0];
  629.             if(true)
  630.             {
  631.                param1.filters = (_loc2_.strength = _loc2_.strength * 0.7) < 0.25 ? [] : [_loc2_];
  632.             }
  633.          }
  634.       }
  635.       
  636.       private function SelectControlButton(param1:SimpleButton) : void
  637.       {
  638.          var _loc2_:Object = null;
  639.          for each(_loc2_ in mControlButtons)
  640.          {
  641.             if(true)
  642.             {
  643.                if(_loc2_.mButton == param1)
  644.                {
  645.                   if(true)
  646.                   {
  647.                      _loc2_.mButton.enabled = false;
  648.                      if(true)
  649.                      {
  650.                         _loc2_.mButton.transform.colorTransform = mcHUD.mcControl.mSelectedCT;
  651.                         mPlayState = _loc2_.mState;
  652.                      }
  653.                      continue;
  654.                   }
  655.                }
  656.                else
  657.                {
  658.                   _loc2_.mButton.enabled = true;
  659.                }
  660.                _loc2_.mButton.transform.colorTransform = mcHUD.mcControl.mDefaultCT;
  661.             }
  662.          }
  663.       }
  664.       
  665.       private function e_PANELUNIT_SELECTED(param1:Event = null) : void
  666.       {
  667.          if(true)
  668.          {
  669.             DeselectAll(false,false);
  670.             if(true)
  671.             {
  672.                if(mSelectedPanel.mID != "unit")
  673.                {
  674.                   prevSelectedPanel = mSelectedPanel;
  675.                }
  676.             }
  677.             mSelectedPanel = CHUDPanel(param1.currentTarget);
  678.          }
  679.       }
  680.       
  681.       public function get mHealth() : Number
  682.       {
  683.          return _Health;
  684.       }
  685.       
  686.       public function get mMap() : CMap
  687.       {
  688.          return mGame.mWorld.mMap;
  689.       }
  690.       
  691.       public function SetStageInfo(param1:int, param2:int = 0, param3:Number = 0) : void
  692.       {
  693.          param1++;
  694.          mcHUD.tbLevelInfo.text = !!param3 ? (param1 == 100 ? "GAME COMPLETE" : "STAGE " + (param1 + 1) + " in " + String(Math.floor(param3 / 25)) + " seconds") : "STAGE " + param1;
  695.       }
  696.       
  697.       public function Initialize(param1:Event = null) : void
  698.       {
  699.          removeEventListener(Event.ADDED_TO_STAGE,Initialize);
  700.          addChild(mcSelectedThing = new Unit_Selected());
  701.          mThingTargets = new Object();
  702.          Compile(new HUD());
  703.          mFundsSecure = new CSecureNumber();
  704.          mFunds = CLevelData.mStartFunds + Math.random();
  705.          mMaxHealth = 200 + Math.random();
  706.          mHealth = mMaxHealth;
  707.          mUpdateHealth = false;
  708.          mUpdateFunds = false;
  709.          tbFunds.text = NumberToDollar(mFunds);
  710.          mMouse.addEventListener(CMouse.ACTION_SELECTFRIEND,e_ACTION_SELECTFRIEND);
  711.          ResetDescription();
  712.          SetupControl();
  713.       }
  714.       
  715.       public function set mFunds(param1:Number) : void
  716.       {
  717.          mFundsChange += Math.floor(param1 - mFundsSecure.mValue);
  718.          mFundsSecure.mValue = param1;
  719.          mUpdateFunds = true;
  720.       }
  721.       
  722.       private function e_PANEL_SELECTED(param1:Event = null) : void
  723.       {
  724.          if(true)
  725.          {
  726.             DeselectAll(false);
  727.             mSelectedPanel = CHUDPanel(param1.currentTarget);
  728.          }
  729.       }
  730.       
  731.       public function get mLandscape() : CLandscape
  732.       {
  733.          return mGame.mWorld.mLandscape;
  734.       }
  735.       
  736.       public function get mSelectedPanel() : CHUDPanel
  737.       {
  738.          return _SelectedPanel;
  739.       }
  740.       
  741.       public function e_PANELUNIT_DRAW(param1:Event = null) : void
  742.       {
  743.       }
  744.       
  745.       public function SetupControl() : void
  746.       {
  747.          if(true)
  748.          {
  749.             mControlButtons = new Object();
  750.             if(true)
  751.             {
  752.                mcHUD.mcControl.mSelectedCT = mcHUD.mcControl.bFast.transform.colorTransform;
  753.                if(true)
  754.                {
  755.                   mcHUD.mcControl.mDefaultCT = mcHUD.mcControl.bPause.transform.colorTransform;
  756.                   if(true)
  757.                   {
  758.                      AddControlButton(mcHUD.mcControl.bPause,"pause","Click to pause the game. Here you will find statistics on your play.");
  759.                   }
  760.                   AddControlButton(mcHUD.mcControl.bPlay,"play","Click to play the game at normal speed.");
  761.                }
  762.                AddControlButton(mcHUD.mcControl.bFast,"fast","Click to play the game at 10 x the normal speed.");
  763.             }
  764.             Control_Play();
  765.          }
  766.       }
  767.       
  768.       public function set mDescription(param1:String) : void
  769.       {
  770.          tbDescription.text = param1;
  771.       }
  772.       
  773.       public function Resize(param1:int, param2:int) : void
  774.       {
  775.       }
  776.       
  777.       private function e_OPEN_HELP(param1:MouseEvent = null) : void
  778.       {
  779.          CURL.GameGuide();
  780.       }
  781.       
  782.       public function get mFunds() : Number
  783.       {
  784.          return mFundsSecure.mValue;
  785.       }
  786.       
  787.       private function AddControlButton(param1:SimpleButton, param2:String, param3:String) : void
  788.       {
  789.          if(true)
  790.          {
  791.             param1.addEventListener(MouseEvent.MOUSE_UP,e_BUTTON_UP);
  792.             mControlButtons[param2] = {
  793.                "mButton":param1,
  794.                "mState":param2,
  795.                "mTooltip":new CHUDTooltip(this,param1,param3)
  796.             };
  797.          }
  798.       }
  799.    }
  800. }
  801.